resource "google_compute_snapshot" "<%= ctx[:primary_resource_id] %>" {
  name        = "<%= ctx[:vars]['snapshot_name'] %>"
  source_disk = google_compute_disk.persistent.name
  zone        = "us-central1-a"
  labels = {
    my_label = "value"
  }
  storage_locations = ["us-central1"]
}

data "google_compute_image" "debian" {
  family  = "debian-9"
  project = "debian-cloud"
}

resource "google_compute_disk" "persistent" {
  name  = "<%= ctx[:vars]['disk_name'] %>"
  image = data.google_compute_image.debian.self_link
  size  = 10
  type  = "pd-ssd"
  zone  = "us-central1-a"
}
